Integrand size = 36, antiderivative size = 143 \[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {\sqrt {2} \sqrt {a} (i A+B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {8 B \sqrt {a+i a \tan (c+d x)}}{5 d}+\frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {2 (5 i A+B) (a+i a \tan (c+d x))^{3/2}}{15 a d} \]
(I*A+B)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))*2^(1/2)*a^(1 /2)/d-8/5*B*(a+I*a*tan(d*x+c))^(1/2)/d+2/5*B*(a+I*a*tan(d*x+c))^(1/2)*tan( d*x+c)^2/d-2/15*(5*I*A+B)*(a+I*a*tan(d*x+c))^(3/2)/a/d
Time = 1.28 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.78 \[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\frac {15 \sqrt {2} \sqrt {a} (i A+B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )+2 \sqrt {a+i a \tan (c+d x)} \left (-5 i A-13 B+(5 A-i B) \tan (c+d x)+3 B \tan ^2(c+d x)\right )}{15 d} \]
(15*Sqrt[2]*Sqrt[a]*(I*A + B)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]* Sqrt[a])] + 2*Sqrt[a + I*a*Tan[c + d*x]]*((-5*I)*A - 13*B + (5*A - I*B)*Ta n[c + d*x] + 3*B*Tan[c + d*x]^2))/(15*d)
Time = 0.71 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.05, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3042, 4080, 27, 3042, 4075, 3042, 4010, 3042, 3961, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \tan (c+d x)^2 \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x))dx\) |
\(\Big \downarrow \) 4080 |
\(\displaystyle \frac {2 \int -\frac {1}{2} \tan (c+d x) \sqrt {i \tan (c+d x) a+a} (4 a B-a (5 A-i B) \tan (c+d x))dx}{5 a}+\frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {\int \tan (c+d x) \sqrt {i \tan (c+d x) a+a} (4 a B-a (5 A-i B) \tan (c+d x))dx}{5 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {\int \tan (c+d x) \sqrt {i \tan (c+d x) a+a} (4 a B-a (5 A-i B) \tan (c+d x))dx}{5 a}\) |
\(\Big \downarrow \) 4075 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {\int \sqrt {i \tan (c+d x) a+a} (a (5 A-i B)+4 a B \tan (c+d x))dx+\frac {2 (B+5 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}}{5 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {\int \sqrt {i \tan (c+d x) a+a} (a (5 A-i B)+4 a B \tan (c+d x))dx+\frac {2 (B+5 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}}{5 a}\) |
\(\Big \downarrow \) 4010 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {5 a (A-i B) \int \sqrt {i \tan (c+d x) a+a}dx+\frac {2 (B+5 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {8 a B \sqrt {a+i a \tan (c+d x)}}{d}}{5 a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {5 a (A-i B) \int \sqrt {i \tan (c+d x) a+a}dx+\frac {2 (B+5 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {8 a B \sqrt {a+i a \tan (c+d x)}}{d}}{5 a}\) |
\(\Big \downarrow \) 3961 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {-\frac {10 i a^2 (A-i B) \int \frac {1}{a-i a \tan (c+d x)}d\sqrt {i \tan (c+d x) a+a}}{d}+\frac {2 (B+5 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {8 a B \sqrt {a+i a \tan (c+d x)}}{d}}{5 a}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {2 B \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)}}{5 d}-\frac {-\frac {5 i \sqrt {2} a^{3/2} (A-i B) \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}+\frac {2 (B+5 i A) (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {8 a B \sqrt {a+i a \tan (c+d x)}}{d}}{5 a}\) |
(2*B*Tan[c + d*x]^2*Sqrt[a + I*a*Tan[c + d*x]])/(5*d) - (((-5*I)*Sqrt[2]*a ^(3/2)*(A - I*B)*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/(Sqrt[2]*Sqrt[a])])/d + (8*a*B*Sqrt[a + I*a*Tan[c + d*x]])/d + (2*((5*I)*A + B)*(a + I*a*Tan[c + d*x])^(3/2))/(3*d))/(5*a)
3.1.68.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[Sqrt[(a_) + (b_.)*tan[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2*(b/d) Subst[Int[1/(2*a - x^2), x], x, Sqrt[a + b*Tan[c + d*x]]], x] /; FreeQ[{a , b, c, d}, x] && EqQ[a^2 + b^2, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Simp [(b*c + a*d)/b Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e , f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && !LtQ[m, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B *d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f* x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && !LeQ[m, -1]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[B*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^n/(f*(m + n))), x] + Simp[ 1/(a*(m + n)) Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n - 1)*Sim p[a*A*c*(m + n) - B*(b*c*m + a*d*n) + (a*A*d*(m + n) - B*(b*d*m - a*c*n))*T an[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && GtQ[n, 0]
Time = 0.18 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.87
method | result | size |
derivativedivides | \(\frac {2 i \left (\frac {i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {5}{2}}}{5}-\frac {i B a \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-\frac {A a \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+i a^{2} B \sqrt {a +i a \tan \left (d x +c \right )}+\frac {a^{\frac {5}{2}} \left (-i B +A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}\right )}{d \,a^{2}}\) | \(124\) |
default | \(\frac {2 i \left (\frac {i B \left (a +i a \tan \left (d x +c \right )\right )^{\frac {5}{2}}}{5}-\frac {i B a \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-\frac {A a \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+i a^{2} B \sqrt {a +i a \tan \left (d x +c \right )}+\frac {a^{\frac {5}{2}} \left (-i B +A \right ) \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}\right )}{d \,a^{2}}\) | \(124\) |
parts | \(\frac {2 i A \left (-\frac {\left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}+\frac {a^{\frac {3}{2}} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}\right )}{d a}+\frac {2 B \left (-\frac {\left (a +i a \tan \left (d x +c \right )\right )^{\frac {5}{2}}}{5}+\frac {a \left (a +i a \tan \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-a^{2} \sqrt {a +i a \tan \left (d x +c \right )}+\frac {a^{\frac {5}{2}} \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {a +i a \tan \left (d x +c \right )}\, \sqrt {2}}{2 \sqrt {a}}\right )}{2}\right )}{d \,a^{2}}\) | \(153\) |
2*I/d/a^2*(1/5*I*B*(a+I*a*tan(d*x+c))^(5/2)-1/3*I*B*a*(a+I*a*tan(d*x+c))^( 3/2)-1/3*A*a*(a+I*a*tan(d*x+c))^(3/2)+I*a^2*B*(a+I*a*tan(d*x+c))^(1/2)+1/2 *a^(5/2)*(A-I*B)*2^(1/2)*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1 /2)))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 383 vs. \(2 (112) = 224\).
Time = 0.26 (sec) , antiderivative size = 383, normalized size of antiderivative = 2.68 \[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {15 \, \sqrt {2} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} + {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) - 15 \, \sqrt {2} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \log \left (-\frac {4 \, {\left ({\left (-i \, A - B\right )} a e^{\left (i \, d x + i \, c\right )} - {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \sqrt {-\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a}{d^{2}}} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{i \, A + B}\right ) + 4 \, \sqrt {2} {\left ({\left (10 i \, A + 17 \, B\right )} e^{\left (5 i \, d x + 5 i \, c\right )} + 10 \, {\left (i \, A + 2 \, B\right )} e^{\left (3 i \, d x + 3 i \, c\right )} + 15 \, B e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{30 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
-1/30*(15*sqrt(2)*(d*e^(4*I*d*x + 4*I*c) + 2*d*e^(2*I*d*x + 2*I*c) + d)*sq rt(-(A^2 - 2*I*A*B - B^2)*a/d^2)*log(-4*((-I*A - B)*a*e^(I*d*x + I*c) + (d *e^(2*I*d*x + 2*I*c) + d)*sqrt(-(A^2 - 2*I*A*B - B^2)*a/d^2)*sqrt(a/(e^(2* I*d*x + 2*I*c) + 1)))*e^(-I*d*x - I*c)/(I*A + B)) - 15*sqrt(2)*(d*e^(4*I*d *x + 4*I*c) + 2*d*e^(2*I*d*x + 2*I*c) + d)*sqrt(-(A^2 - 2*I*A*B - B^2)*a/d ^2)*log(-4*((-I*A - B)*a*e^(I*d*x + I*c) - (d*e^(2*I*d*x + 2*I*c) + d)*sqr t(-(A^2 - 2*I*A*B - B^2)*a/d^2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1)))*e^(-I*d *x - I*c)/(I*A + B)) + 4*sqrt(2)*((10*I*A + 17*B)*e^(5*I*d*x + 5*I*c) + 10 *(I*A + 2*B)*e^(3*I*d*x + 3*I*c) + 15*B*e^(I*d*x + I*c))*sqrt(a/(e^(2*I*d* x + 2*I*c) + 1)))/(d*e^(4*I*d*x + 4*I*c) + 2*d*e^(2*I*d*x + 2*I*c) + d)
\[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \left (A + B \tan {\left (c + d x \right )}\right ) \tan ^{2}{\left (c + d x \right )}\, dx \]
Time = 0.31 (sec) , antiderivative size = 130, normalized size of antiderivative = 0.91 \[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {i \, {\left (15 \, \sqrt {2} {\left (A - i \, B\right )} a^{\frac {7}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 12 i \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {5}{2}} B a + 20 \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} {\left (A + i \, B\right )} a^{2} - 60 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a} B a^{3}\right )}}{30 \, a^{3} d} \]
-1/30*I*(15*sqrt(2)*(A - I*B)*a^(7/2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan (d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*x + c) + a))) - 12*I*(I* a*tan(d*x + c) + a)^(5/2)*B*a + 20*(I*a*tan(d*x + c) + a)^(3/2)*(A + I*B)* a^2 - 60*I*sqrt(I*a*tan(d*x + c) + a)*B*a^3)/(a^3*d)
Timed out. \[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=\text {Timed out} \]
Time = 8.28 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.17 \[ \int \tan ^2(c+d x) \sqrt {a+i a \tan (c+d x)} (A+B \tan (c+d x)) \, dx=-\frac {2\,B\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}-\frac {A\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}\,2{}\mathrm {i}}{3\,a\,d}+\frac {2\,B\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}}{3\,a\,d}-\frac {2\,B\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{5/2}}{5\,a^2\,d}+\frac {\sqrt {2}\,A\,\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{d}-\frac {\sqrt {2}\,B\,\sqrt {a}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2\,\sqrt {a}}\right )\,1{}\mathrm {i}}{d} \]
(2*B*(a + a*tan(c + d*x)*1i)^(3/2))/(3*a*d) - (A*(a + a*tan(c + d*x)*1i)^( 3/2)*2i)/(3*a*d) - (2*B*(a + a*tan(c + d*x)*1i)^(1/2))/d - (2*B*(a + a*tan (c + d*x)*1i)^(5/2))/(5*a^2*d) + (2^(1/2)*A*(-a)^(1/2)*atan((2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2))/(2*(-a)^(1/2)))*1i)/d - (2^(1/2)*B*a^(1/2)*atan( (2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2)*1i)/(2*a^(1/2)))*1i)/d